package com.mcp.Tools;

import com.mcp.entity.Users;
import com.mcp.service.IUsersService;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ToolsService {
    @Autowired
    IUsersService iUsersService;
    @Tool(description = "获取分页用户信息")
    public List<Users> getAllUsers(@ToolParam(description = "当前页") Integer page, @ToolParam(description = "页码") Integer pageSize) {
        return iUsersService.getAllUsers(page, pageSize);
    }
    @Tool(description = "根据用户姓名获取用户信息")
    public List<Users> getAllUsersByUserName(@ToolParam(description = "用户姓名") String userName){
        return iUsersService.getAllUsersByUserName(userName);
    }
}
